package com.neuedu.thread;

public class Thread02Demo {
    public static void main(String[] args) {

        MyThread  mt = new MyThread();
        Thread  t = new Thread(mt);
        t.start();
        for(int i = 0; i<10000;i+=2){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(i);
        }
    }
}

class  MyThread  implements Runnable{

    @Override
    public void run() {
        for(int j = 1;j < 10000;j+=2){
            try {
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.err.println(j);
        }
    }
}

